{extend name="default/base/base_seller" /}
{block name="seller_main"}

<form method="get" action="">

    <input type="hidden" name="lock" value="{$Request.param.lock}" />
    <table class="search-form">
        <tr>
            <th class="">
                    方案名称
            </th>
            <td class="w160" ><input type="text" class="text" name="keyword" value="{$Request.get.keyword}" /></td>

            <th class="">
                   配置类型
            </th>
            <td class="" >
                <select name="configure" id="">
                    <option value="">请选择</option>
                    <option value="1" {$Request.get.configure == 1 ? 'selected' : ''}>低端配置</option>
                    <option value="2" {$Request.get.configure == 2 ? 'selected' : ''}>中端配置</option>
                    <option value="3" {$Request.get.configure == 3 ? 'selected' : ''}>高端配置</option>
                </select>
            </td>

            <td class="w70 " style=""><input type="submit" class="submit" value="{$Think.lang.ds_search}" /></td>
            <td class="w70 "><a style="margin-left: -20px;" href="{:url('sellerinquiry/index')}" class="dssc-btn dssc-btn-red" title="取消">取消</a></td>
            <td><a href="javascript:void(0)" onclick="add_inquiry();" style=" margin-left: -50px;" class="dssc-btn dssc-btn-green" title="添加询价方案">添加询价方案</a></td>
<!--            <td><a href="{:url('sellerinquiry/export_step1')}" style=" margin-left: -50px;" class="dssc-btn dssc-btn-green" title="导出Excel">导出Excel</a></td>-->

        </tr>
    </table>
</form>

<table class="dssc-default-table">
            <thead>
                <tr>
                    <th class="w10"></th>
                    <th>方案名称</th>
                    <th>店铺类型</th>
                    <th>配置类型</th>
                    <th>创建时间</th>
                    <th class="w120">{$Think.lang.ds_handle}</th>
                </tr>
            </thead>
            <tbody>
                {notempty name="inquiry_list"}
                {foreach name="inquiry_list" item="bill_info" }
                <tr class="bd-line">
                    <td></td>
                    <td>{$bill_info.scheme_name}</td>
                    <td>{$bill_info.inquiry_name}</td>
                    <td>
                        {if condition="($bill_info.configure==1)"}低端配置
                        {elseif condition="($bill_info.configure==2)"}中端配置
                        {elseif condition="($bill_info.configure==3)"}高端配置
                        {/if}
                    </td>
                    <td>{$bill_info.c_time|date="Y-m-d H:i:s",###}</td>
                    <td class="dscs-table-handle" style="height: 68px;width: 221px;">
                        <span> <a href="javascript:dsLayerOpen('{:url('Sellerinquiry/detail',['id'=>$bill_info.id])}','查看-{$bill_info.scheme_name}','700px','500px')" class="btn-green"><i class="iconfont">&#xe70b;</i><p>{$Think.lang.ds_view}</p></a></span>
                        <!-- <a  href="javascript:dsLayerOpen('{:url('Sellerinquiry/detail',['id'=>$bill_info.id])}','查看-{$bill_info.scheme_name}','700px','500px')"  class="btn-green">
                         <p >查看详情</p>
                        </a> -->
                        <span> <a href="{:url('Sellerinquiry/sellergoods',['id'=>$bill_info.id])}" class="btn-orange"><i class="iconfont">&#xe731;</i><p>商品管理</p></a></span>
                        <!-- <a href="{:url('Sellerinquiry/sellergoods',['id'=>$bill_info.id])}" class="dsui-btn-edit"><i class="iconfont"></i>商品管理</a> -->
                        <!-- <span> <a href="javascript:void(0);" data-id="{$bill_info.id}" class="btn-red"><i class="layui-icon">&#xe640;</i><p>删除</p></a></span> -->
                        <span><a href="javascript:void(0);" data-id="{$bill_info.id}" class="btn-red seller-drop"><i class="layui-icon">&#xe640;</i><p>删除</p></a></span>
                        <span> <a href="{:url('sellerinquiry/export_step1', ['id' => $bill_info.id])}" class="btn-orange"><i class="layui-icon">&#xe67d;</i><p>导出</p></a></span>
                        <!-- <a href="{:url('sellerinquiry/export_step1', ['id' => $bill_info.id])}" style=" margin-left: -50px;" class="dsui-btn-edit" title="导出Excel"><center>导出Excel</center></a> -->
                    </td>
                </tr>
                {/foreach}
                {else/}
                <tr>
                    <td colspan="6" class="norecord"><div class="warning-option"><i class="iconfont">&#xe64c;</i><span>{$Think.lang.no_record}</span></div></td>
                </tr>
                {/notempty}
            </tbody>
            <tfoot>
                {notempty name="bill_list"}
                <tr>
                    <td colspan="6"><div class="pagination">{$show_page}</div></td>
                </tr>
                {/notempty}
            </tfoot>
        </table>
        <script src="{$Think.HOME_SITE_ROOT}/js/store_goods_list.js"></script>
        <script type="text/javascript">
        $(function(){
            $('#query_start_date').datepicker({dateFormat: 'yy-mm-dd'});
            $('#query_end_date').datepicker({dateFormat: 'yy-mm-dd'});
        });

        //导入商品
            function add_goods(ids_str) {
              _uri = HOMESITEURL+"/Sellerinquiry/sellergoods?id=" + ids_str;
                dsLayerOpen(_uri,'导入商品','700px','600px');
            }


        //我要询价
        function add_inquiry() {
            _uri = HOMESITEURL+"/Sellerinquiry/add_inquiry";
            dsLayerOpen(_uri,'询价方案','700px','600px');
        }
        /**
         * Layer 通用ifram弹出窗口
         */
        function dsLayerOpen(url, title,width,height) {
            if (!width) width = '900px';
            if (!height) height = '500px';
            layer.open({
                type: 2,
                title: title,
                area: [width,height],
                fixed: false, //不固定
                maxmin: true,
                content: url
            });
        }

        $('.seller-drop').click(function () {
            var id = $(this).attr('data-id');
            var that = $(this)
            var index = layer.confirm('确定要删除吗？',function () {
                $.post("{:url('Sellerinquiry/seller_drop')}", {
                    id: id
                }, function (res) {
                    layer.msg(res.message);
                    if (res.code == 0) {
                        // that.parent().parent().remove(); // 移除该数据
                        location.href=res.url;return false;
                    }
                }, 'json')
                // layer.close(index);
            })
        })
        </script>


{/block}

